#pragma once

#include "Renderer.h"
#include <unordered_map>
#include <glm/glm.hpp>

class Shader
{	
private:
	string m_vsFilePath, m_fsFilePath;
	unsigned int m_RenderID = 0;

	unordered_map<string, int> m_locationMap;

public:
	Shader(const string& vsFilePath,const string& fsFilePath);
	~Shader();


	void Bind() const;
	void Unbind() const;


	void SetUniform4f(const string& name, float x, float y, float z, float w);
	void SetUniform1i(const string& name, int x);
	void SetUniform1f(const string& name, float x);
	void SetUniformMatrix4(const string& name, const glm::mat4& matrix);
private:
	int GetUniformLocation(const string& name);
	unsigned int CreateShader(const string& vertexShader, const string& fragmentShader);
	unsigned int CompileShader(const string& source, unsigned int shaderType);
};

